package com.mofang.powerdekorhelper.base;

import android.app.Activity;

/**
 * Created by luofei on 2017/8/19 0019.
 */

public abstract class MvpFragment<V, P extends BasePresent<V>> extends BaseFragment {

    protected P presenter;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        presenter = initPresenter();
        presenter.attach((V) this);
    }

    @Override
    public void onDestroyView() {
        presenter.detach();
        super.onDestroyView();
    }

    public abstract P initPresenter();
}
